Skip to content

Add verified member portfolio page (#150) - #180

Open
Soham1660 wants to merge 1 commit into
candiedoperation:masterfrom
Soham1660:feature/150-member-portfolio
Open

Soham1660 wants to merge 1 commit into
candiedoperation:masterfrom
Soham1660:feature/150-member-portfolio

Conversation

@Soham1660

@Soham1660 Soham1660 commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Closes #150

Summary

Members can opt in to a public, read-only portfolio at /u/:username. It shows their name, photo, club roles (current and past), awards, project teams, and a "Verified by App Dev Club" badge, plus an optional section they write themselves that is clearly labelled as not verified. Portfolios are private by default.

What's included

  • Public page (/u/:username, dark theme): header with avatar (blue-to-teal initials when there's no photo), verified badge and an Alumni tag when the member has no current team; a provenance strip with the sync time; a "Club record" card (term, role, team, team-type pill, current role marked Ongoing); Awards; a Projects grid (term range and roles held); the member-written "From " section; and a footer.
  • Settings card on the member's own profile: on/off switch, share link with Copy and Open, what's shown and what's never shown, per-role and per-award show/hide switches (disabled and greyed out while off, hidden items marked "hidden from your page"), and the headline, GitHub and LinkedIn fields.
  • Award management for leads: an award button on each row of the team member list opens a dialog to grant (title, optional one-line reason, date) and revoke awards.

API

Endpoint Auth Purpose
GET /api/portfolio/{username} none Public portfolio, whitelisted fields only
GET /api/portfolio/me/settings signed in Own settings, plus every role and award with the id its switch uses
PATCH /api/portfolio/me/settings signed in isPublic, hiddenRoleIds, hiddenAwardIds, headline, githubUrl, linkedinUrl
GET /api/portfolio/teams/{teamId}/members/{userPk}/awards corp:membermgmt A team member's awards, with which ones this team can revoke
POST /api/portfolio/teams/{teamId}/members/{userPk}/awards corp:membermgmt Grant an award
DELETE /api/portfolio/teams/{teamId}/members/{userPk}/awards/{awardId} corp:membermgmt Revoke an award

The member is always taken from the session for me/settings. (This replaces PATCH /api/portfolio/settings from the first version of this PR.)

Privacy

  • Off by default. A member who hasn't opted in, has turned it off, doesn't exist, isn't onboarded, or has an ambiguous username gets the same 404 "Portfolio not found".
  • The public response is built field by field: no email, phone, major, graduation date, LinkedIn on file, user ids, team ids, award ids or grant metadata.
  • Member-written fields are validated on the server: one line of plain text (no <, > or control characters), headline at most 160 characters, links must be https:// on github.com or linkedin.com/in/ with no credentials, port or extra path. Stored values are re-checked when read. React escapes everything on render, and member links use rel="noopener noreferrer nofollow".

Design notes

  • Award permission: reuses corp:membermgmt, the bindle that already controls adding and removing team members, which is the closest existing permission. Team owners and executives pass it as usual. The target must be in the team (root or a subteam). An award records the root team it was granted through, and only that team can revoke it. Because root-team members count as owners, a member could otherwise grant themselves an award, so granting or revoking your own awards is refused.
  • Role history storage: when someone is removed from a team, removeTeamMemberWrapper copies the role (team name, subteam, role title, team type, season, year, end date) into a roleHistory user attribute in the same Authentik update that removes it from roles, capped at 100 entries. History merges with current roles and is de-duplicated, so someone removed and re-added shows the role once. Hide switches work on history entries by id.
  • Awards storage: an awards user attribute (at most 50). Settings, history and awards are all on the Authentik user; no new collection.
  • Current vs past: a role is current if the member still holds the membership and its season is the current season or later (Spring runs January to July, Fall August to December). Service teams with rolling seasons count as current while held. "Alumni" means no current role at all, hidden or not, so a hidden current role never makes the page claim the member is an alumnus.
  • Share previews: /u/:username now reads the built index.html, swaps the title and adds Open Graph and Twitter tags (og:title " · Verified by App Dev Club", description from current roles), all HTML-escaped. Private and missing pages get the same generic tags and the same status as before. No og:image, because avatar URLs are short-lived signed links.
  • Styling: design colors use the matching Tailwind palette (rose-500, zinc-800/zinc-700/zinc-400, green-400/300/800/900/950); only #111113 and #0b1d14 are hardcoded. The public page is always dark. The settings card uses the design colors in dark mode and the app's theme tokens in light mode.

Not done

  • Contribution areas (from Horizon) are not included. Horizon's pipeline writes per-repository and per-file line ownership to its own Postgres schema (horizon_gt_features), keyed by Authentik user pk. It has no notion of an "area", and People Portal has no connection to that database. Horizon's read API only exposes executive-gated rankings, and its store adapter deliberately returns unavailable. To do this for real we'd need: an agreed definition of an area (e.g. a mapping from repository or path prefix to an area name), a read endpoint or view exposing a member's areas without line counts, and a way for the portal to reach it.
  • Inter isn't bundled. The page asks for Inter and falls back to the system font; loading it would add a font dependency.
  • No backfill of role history for removals before this change (as agreed).

Testing

  • Server: 29 portfolio tests (190 server tests in total, all passing): role history merge and de-dup, the history write on removal, hiding history entries, award permissions (bindle on all award routes, team-membership check, granting-team-only revoke, no self-grant), award validation and visibility, headline and URL validation, settings defaults, share-tag escaping, and identical private and missing pages.
  • Webui: 21 tests across the public page, settings card and awards dialog (53 in total, all passing).
  • Formatting and static checks: prettier@3.9.10 --check passes on both src folders. Lint and type check show no new problems (the existing 91 lint errors and 18 type errors on master are unchanged).
  • Local dev stack (Authentik): history was created through the real removal path; two awards were granted through the real bindle-protected endpoints; a markup title was rejected (400); a member granting themselves an award was refused (403); an http:// GitHub link was rejected (400); the share tags were checked on a public page, and a private page's HTML was byte-identical to a missing one's. PATCH was exercised through a real browser sign-in this time.

Members can opt in to a public, read-only portfolio at /u/:username showing
their name, photo, club roles, awards, project teams and a "Verified by App
Dev Club" badge. Portfolios are private by default; a private, unknown or
ambiguous username gets the same 404. Settings live on the member's Authentik
attributes and are changed from a settings card on their own profile page.

Role history: removing a member from a team now copies the role (team,
subteam, title, type, season, year, end date) into a roleHistory user
attribute in the same update, so past roles stay on the portfolio. The public
response merges current roles with history and de-duplicates them.

Awards: leads holding corp:membermgmt on a team (team owners and executives
pass) can grant and revoke awards for that team's members from the team
member list. Only the granting team can revoke, and nobody can grant or
revoke their own. Members can hide an award but never add or edit one.

Member-written section: an optional headline and GitHub and LinkedIn links,
validated on the server (https only, expected site, length caps, plain text)
and shown apart from the verified record. The LinkedIn on file is never used.

Share previews: /u/:username serves the app with Open Graph and Twitter tags
for public portfolios, HTML-escaped. Private and missing pages get identical
generic tags.

API: GET /api/portfolio/{username} (public, whitelisted fields only);
GET and PATCH /api/portfolio/me/settings (signed-in member's own settings);
GET, POST /api/portfolio/teams/{teamId}/members/{userPk}/awards and
DELETE .../awards/{awardId} (corp:membermgmt).
@Soham1660
Soham1660 force-pushed the feature/150-member-portfolio branch from 59cb22e to 3374376 Compare December 3, 2026 23:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Verified member portfolio: a shareable, club-verified profile page for every member

1 participant